import React from "react";
import { connect } from "react-redux";



function App(props){
    return (
        <>
            <div>App{props.msg}</div>
            <button onClick={props.changeMsgFn}>点击</button>
        </>    
    )
}
const mapStateToProps=(state)=>{
    return {
        msg:state.msg
    }
}
const mapDispatchToProps=(dispatch)=>{
    return{
        changeMsgFn(){
            const action={type:'changeMsgFn',value:'hello-word'};
            dispatch(action);
        }
    }
}
export default connect(mapStateToProps,mapDispatchToProps)(App);